import java.util.Scanner;

public class Main {

    public String isWin;
    public static void main(String[] args) {
        Main main = new Main();
        System.out.println("开始游戏请按1");
        NGuessNumber nGuessNumber = new NGuessNumber();
        Scanner input = new Scanner(System.in);
        int x = input.nextInt();
        while (x == 1) {
            main.isWin = String.valueOf(nGuessNumber.compareGuessAnswer());
            switch (main.isWin) {
                case "true":
                    System.out.println("获胜啦！");
                    break;
                case "false":
                    System.out.println("失败啦！");
                    break;
            }
            System.out.println("是否继续游戏，继续请按1，结束请按2");
            int y = input.nextInt();
            if (y == 2) {
                break;
            }
        }

    }
}
